<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller{
	public function index(){
		if(!empty($_POST['name']) && !empty($_POST['password']) ){
			session_start();
			$_SESSION['name']=$name=trim($_POST['name']);
			$password=trim($_POST['password']);
			$user=M('user');
			$result=$user->where("name='$name' and  password='$password'")->find();
			if(!empty($result)){
				//header("Location:./Public/App/index.php?name=".$name);
				header("Location:./Public/App/index.php");
			}
		   	else{
		   		echo '<script>alert("不好意思，你不是本站的会员");</script>';
		    }
		}
		$this->display();
	}
}
?>